package com.leyou.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.shop.entity.OrderShop;
import com.leyou.shop.entity.UpdateLog;
import com.leyou.shop.mapper.UpdateLogMapper;
import com.leyou.shop.service.IOrderShopService;
import com.leyou.shop.mapper.OrderShopMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cyb
 * @since 2022-07-14
 */
@Service
public class OrderShopServiceImpl extends ServiceImpl<OrderShopMapper, OrderShop> implements IOrderShopService {

    @Autowired
    OrderShopMapper orderShopMapper;
    @Autowired
    UpdateLogMapper logMapper;
    @Override
    public List<OrderShop> selectCount() {
        return orderShopMapper.selectOrderShopCount();
    }

    @Override
    @Transactional
    public int updateStatu(UpdateLog updateLog) {
        logMapper.addLog(updateLog);
        int i = orderShopMapper.updateStatu(updateLog.getId(),updateLog.getExpressNum());
        return i;
    }
}
